#include<bits/stdc++.h>
#define ll long long 
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    void pc(const char *s){
    	while(*s)putch(*s),s++;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x),putch(' '),write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
struct node{
	int x,y;
	friend bool operator <(node A,node B){
		return A.x==B.x?A.y<B.y:A.x<B.x;
	}
};
void Rebuild(vector<node>&a){
	vector<node>b;
	sort(a.begin(),a.end());
	for(int i=0;i<a.size();i++){
		while(b.size()&&b.back().y<a[i].y){
			b.pop_back();
		}
		b.push_back(a[i]);
	}
	a=b;
	return;
}
const int N=1e3+5;
const ll Inf=1e18;
int n,m,asd;ll ans=Inf;
vector<node>a,b;
bool check(vector<int>s){
	for(int i=0;i<n;i++)
		if(s[i]>0)return 0;
	return 1;
}
void dfs(int now,vector<int>s,int sum){
	if(sum>=ans)return;
	if(check(s)){
		ans=sum;
		return;
	}
	if(now==m)return;
	for(int l=0;l<n;l++){
		for(int r=l;r<n;r++){
			s[r]--;
			dfs(now+1,s,sum+max(a[r].x-b[now].x,0)+max(a[l].y-b[now].y,0));
		}
		for(int j=l;j<n;j++)s[j]++;
	}
}
void Sub1(){
	vector<int>s(n,asd);
	dfs(0,s,0);
	write(ans);
}
ll f[N][N];
signed main(){
	freopen("move.in","r",stdin);
	freopen("move.out","w",stdout);
	read(n,m,asd);
	a.resize(n),b.resize(m);
	for(int i=0;i<n;i++)
		read(a[i].x,a[i].y);
	for(int i=0;i<m;i++)
		read(b[i].x,b[i].y);
	Rebuild(a);n=a.size();
	sort(b.begin(),b.end());
	if(n<=10&&m<=10){
		Sub1();
		return flush(),0;
	}
	memset(f,0x3f,sizeof f);
	for(int i=0;i<m;i++)
		f[0][i]=max(a[0].y-b[i].y,0)+max(a[0].x-b[i].x,0);
	for(int i=1;i<n;i++){
		for(int j=0;j<m;j++)
			f[i][j]=f[i-1][j]-max(a[i-1].x-b[j].x,0)+max(a[i].x-b[j].x,0);
		ll k=Inf;
		for(int j=0;j<m;j++)
			f[i][j]=min(f[i][j],k+max(a[i].y-b[j].y,0)+max(a[i].x-b[j].x,0)),
			k=min(k,f[i-1][j]);
		k=Inf;
		for(int j=m-1;j>=0;j--)
			f[i][j]=min(f[i][j],k+max(a[i].y-b[j].y,0)+max(a[i].x-b[j].x,0)),
			k=min(k,f[i-1][j]);
	}
	for(int i=0;i<m;i++)ans=min(ans,f[n-1][i]);
	write(ans);
	return flush(),0;
}/*
3 2 2
0 0
2 0
0 2
1 0
0 1

*/ 

